/*
 *  CrossoverOperator.h
 *  Genetski
 *
 *  Created by Srđan Rašić on 11/19/11.
 *
 */

#pragma once
#include <utility>
#include "Chromosome.h"

/**
 * Defines interface for crossover operators.
 */
class CrossoverOperator {
protected:
	
public:
	 /**
	  * Returns crossover result - child chromosomes generated from parents.
	  */
	virtual std::pair<Chromosome, Chromosome> Crossover(Chromosome& p1, Chromosome& p2) = 0;
};


/**
 * Performs One Point crossingover.
 */
class OnePointCrossoverOperator : public CrossoverOperator {
	int _point;
	
public:
	OnePointCrossoverOperator(int point);
	
	virtual std::pair<Chromosome, Chromosome> Crossover(Chromosome& p1, Chromosome& p2);
};


/**
 * Performs One Point crossingover.
 */
class UniformCrossoverOperator : public CrossoverOperator {
	int _point;
	
public:
	virtual std::pair<Chromosome, Chromosome> Crossover(Chromosome& p1, Chromosome& p2);
};